<?php

namespace app\mini\controller\v1\client\validate;


use think\Validate;

class CommentValidate extends Validate
{
    protected $rule = [
        'shop_id'  => 'require',
        'page'     => 'require',
        'comment_images'     => 'require',
        'order_id' => 'require',
        'star'     => 'between:1,5',
        'anonymous'     => 'between:1,2',
        'comment'     => 'require',
    ];

    protected $message = [
        'page.require' => '页码必填',
        'star.between' => '评分范围错误',
    ];

    protected $scene = [
        'index'        => ['shop_id'],
        'comment'      => ['order_id', 'star','anonymous','comment'],
        'commentCount' => ['shop_id'],
    ];
}